package com.kz.framework.proxy;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import lombok.Data;

/**
 * @author zhgp
 * @version 1.0
 * @description: 上下文
 * @date 2021/7/2 22:48
 */
@Data
public class ProceedingJoinPoint {

    /**
     * 目标方法的参数
     */
    private Object[] args;
    /**
     * 目标对象，实际上是代理对象
     */
    private Object target;
    /**
     * 目标方法
     */
    private Method method;

    public Object proceed(Object[] args) throws InvocationTargetException, IllegalAccessException {
        return method.invoke(target, args);
    }

    public Object proceed() throws InvocationTargetException, IllegalAccessException {
        return method.invoke(target);
    }
}
